#include "module_XExpand.h"

//取MD5_ascii
CXTextA X_Check_GetMD5_Ascii (const char* str)
{
    XMD5 lmd5;
    lmd5.reset();
    lmd5.update(str);
    return lmd5.toString();
}

//取MD5_Unicode
CXTextA X_Check_GetMD5_Unicode (CXText data)
{
    XMD5 md5;
    md5.reset();
    md5.update(data.get (),data.size ());
    return md5.toString();
}

//取MD5_字节集
CXTextA X_Check_GetMD5_Bytes (CXBytes data)
{
    XMD5 md5;
    md5.reset();
    md5.update(data.get (),data.size ());
    return md5.toString();
}

//Base64_编码
CXTextA X_Check_BASE64_EnCode (CXTextA str) {
    string sr(str.get());
    return base64_encode(sr);
}

//Base64_解码
CXTextA X_Check_GetMD5_DeCode (CXTextA str)
{
    string sr(str.get());
    return base64_decode(sr);
}

//Base64_编码_字节集 ()
CXTextA X_Check_BASE64_EnCode_Bytes (CXBytes data)
{
    return base64_decode(data.get(),data.size ());
}

//Base64_解码_字节集 ()
CXTextA X_Check_GetMD5_DeCode_Bytes (CXBytes data)
{
    return base64_decode(data.get(),data.size ());
}

